home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / hruler.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-03  |  2.8 KB  |  114 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                         hruler.h  -  description
  9.                             -------------------
  10.     begin                : Tue Apr 10 2001
  11.     copyright            : (C) 2001 by Franz Schmid
  12.     email                : Franz.Schmid@altmuehlnet.de
  13. ***************************************************************************/
  14.  
  15. /***************************************************************************
  16. *                                                                         *
  17. *   This program is free software; you can redistribute it and/or modify  *
  18. *   it under the terms of the GNU General Public License as published by  *
  19. *   the Free Software Foundation; either version 2 of the License, or     *
  20. *   (at your option) any later version.                                   *
  21. *                                                                         *
  22. ***************************************************************************/
  23.  
  24. #ifndef HRULER_H
  25. #define HRULER_H
  26.  
  27. #include <QWidget>
  28.  
  29. #include "scribusapi.h"
  30. #include "styles/paragraphstyle.h"
  31.  
  32. class PageItem;
  33.  
  34. class QPaintEvent;
  35. class QMouseEvent;
  36. class PrefsManager;
  37. class RulerGesture;
  38. class ScribusView;
  39. class ScribusDoc;
  40. class ScribusMainWindow;
  41.  
  42. /** \brief Horizontal ruler
  43. \author Franz Schmid
  44. */
  45. class SCRIBUS_API Hruler : public QWidget
  46. {
  47.     Q_OBJECT
  48.  
  49. public:
  50.     Hruler(ScribusView *pa, ScribusDoc *doc);
  51.     ~Hruler() {};
  52.  
  53.     bool ItemPosValid;
  54.     double ColGap;
  55.     double lineCorr;
  56.     int Cols;
  57.     double RExtra;
  58.     double Extra;
  59.     double Indent;
  60.     double First;
  61.     double RMargin;
  62.     bool Revers;
  63.     QList<ParagraphStyle::TabRecord> TabValues;
  64.     PageItem * currItem;
  65.     // following is used in view (only read access, see DrawPageItems(), line 822)
  66.     double ItemPos;
  67.     double ItemEndPos;
  68.     double offs;
  69.     
  70.     void setItem(PageItem * item);
  71.  
  72. private:
  73.     void paintEvent(QPaintEvent *e);
  74.     void drawNumber(QString num, int startx, int starty, QPainter & p);
  75.     void mousePressEvent(QMouseEvent *m);
  76.     void mouseReleaseEvent(QMouseEvent *);
  77.     void mouseMoveEvent(QMouseEvent *m);
  78.     void UpdateTabList();
  79.  
  80.     int Markp;
  81.     int oldMark;
  82.     bool Mpressed;
  83.     int ActCol;
  84.     int ActTab;
  85.     double Scaling;
  86.     int RulerCode;
  87.     int MouseX;
  88.  
  89.     ScribusDoc *currDoc;
  90.     ScribusView *currView;
  91.     
  92. public slots: // Public slots
  93.     /** \brief draw mark
  94.     \param where where to draw */
  95.     void Draw(int where);
  96.     void unitChange();
  97.  
  98. signals:
  99.     void DocChanged(bool);
  100.     void MarkerMoved(double, double);
  101.  
  102. private:
  103.     double iter, iter2;
  104.     double cor;
  105.     int whereToDraw;
  106.     bool drawMark;
  107.     PrefsManager *prefsManager;
  108.     RulerGesture* rulerGesture;
  109.  
  110.     //void drawGuides();
  111. };
  112.  
  113. #endif
  114.